package gameos.menu.shop.money;

import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.ui.Table;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;

import gameos.core.Asset;
import gameos.core.GameOS;
import gameos.core.IScreen;
import gameos.core.IVisible;
import gameos.core.Log;
import gameos.menu.IEntityMenu;

public class MoneyUi extends IEntityMenu implements IVisible{

	public MoneyUi (GameOS game, IScreen screen) {
		super(game, screen);
		// TODO Auto-generated constructor stub
	}

	public Table table;
	
	@Override
	public void start () {
		// TODO Auto-generated method stub
		table = game.stageHelper.createTable(game.X(0), game.Y(0), game.X(838), game.Y(490));
		table.addActor(game.stageHelper.createImage(Asset.screenPay, 0, 0));
		table.addActor(game.stageHelper.createButtonLogic(game.X(556), game.Y(490-323), game.X(121), game.Y(73), new ChangeListener() {
			
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				// TODO Auto-generated method stub
				hide();
			}
		}));
		table.addActor(game.stageHelper.createButtonLogic(game.X(323), game.Y(490-120), game.X(490-323), game.Y(120-53), new ChangeListener() {
			
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				// TODO Auto-generated method stub
				Log.show("SMS");
				hide();
			}
		}));
		table.addActor(game.stageHelper.createButtonLogic(game.X(323), game.Y(490-222), game.X(490-323), game.Y(120-53), new ChangeListener() {
			
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				// TODO Auto-generated method stub
				Log.show("Thẻ cào");
				hide();
			}
		}));
		table.addActor(game.stageHelper.createButtonLogic(game.X(323), game.Y(490-326), game.X(490-323), game.Y(120-53), new ChangeListener() {
			
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				// TODO Auto-generated method stub
				Log.show("Tin dung");
				hide();
			}
		}));
		table.addActor(game.stageHelper.createButtonLogic(game.X(323), game.Y(490-424), game.X(490-323), game.Y(120-53), new ChangeListener() {
			
			@Override
			public void changed (ChangeEvent event, Actor actor) {
				// TODO Auto-generated method stub
				Log.show("PayPal");
				hide();
			}
		}));
		hide();
	}

	@Override
	public void stop () {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void draw () {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void update (int delayTime) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void hide () {
		// TODO Auto-generated method stub
		table.setVisible(false);
	}

	@Override
	public void show () {
		// TODO Auto-generated method stub
		table.setVisible(true);
	}

}
